File: //var/www/html/spion/resources/views/admin/user/subscription.blade.php
@extends('adminlte::page')
@include('admin.includes.datatable-axios-files')
@section('title', 'Users Subscription')
@section('content_header')
<h1>User Subscription</h1>
@stop
@section('content')
<div class="card card-dark">
<div class="card-header">
<h3 class="card-title">Subscription Details</h3>
</div>
<div class="card-body">
<div class="form-group">
<label for="search">Search</label>
<x-adminlte-input class="form-control" id="search_keyword" name="search_keyword" placeholder="searching..." />
</div>
<div class="form-group">
<label for="status">Status</label>
@php
$options = ['all' => 'All', 1 => 'Pending', 2 => 'Inactive', 3 => 'Acitve', 4 => 'Failed'];
@endphp
<x-adminlte-select name="status_filter" id="status_filter">
<x-adminlte-options :options="$options" selected="all" />
</x-adminlte-select>
</div>
<table class="table table-bordered yajra-datatable">
<thead>
<tr>
<th>Name</th>
<th>Plan Type</th>
<th>Price</th>
<th>Subscription ID</th>
<th>Start Date</th>
<th>Next Renewal Date</th>
<th>Status</th>
{{-- <th>Actions</th> --}}
</tr>
</thead>
<tbody>
<!-- Data will be populated by DataTables -->
</tbody>
</table>
</div>
</div>
@stop
@section('js')
<script>
$(document).ready(function() {
var table = $('.yajra-datatable').DataTable({
processing: true,
serverSide: true,
pageLength: 10,
searching: false,
ajax: {
url: "{{ route('admin.subscription.view') }}",
type: "GET",
data: function(d) {
d.search_keyword = $('#search_keyword').val();
d.status_filter = $('#status_filter').val();
}
},
columns: [
{ data: 'name', name: 'name' },
{ data: 'plan_name', name: 'plan_name' },
{ data: 'price', name: 'price' },
{ data: 'rz_subscription_id', name: 'rz_subscription_id' },
{ data: 'start_at', name: 'start_at' },
{ data: 'charge_at', name: 'charge_at' },
{ data: 'rz_status', name: 'rz_status' },
// { data: 'action', name: 'action', orderable: false, searchable: false },
]
});
$('#search_keyword, #status_filter').on('change', function() {
table.draw();
});
});
</script>
@stop